﻿<Page 
    x:Class="Milkify.Views.TaskNoteListControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:m="clr-namespace:Milkify"
    xmlns:md="clr-namespace:Milkify.Data"
    Title="Notes"
    KeepAlive="True"
    KeyboardNavigation.IsTabStop="False">
    <DockPanel>
        <Grid
            DockPanel.Dock="Bottom">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Button
                Content="Add Note"
                Command="{Binding AddTaskNoteCommand}" />
        </Grid>
        <ScrollViewer
            VerticalScrollBarVisibility="Auto">
            <ItemsControl
                Name="ListNotes"
                ItemsSource="{Binding TaskNotes}" 
                KeyboardNavigation.IsTabStop="False"
                KeyboardNavigation.DirectionalNavigation="Cycle"
                KeyboardNavigation.TabNavigation="Once" 
                Grid.IsSharedSizeScope="True"
                Style="{DynamicResource TaskNoteListStyle}">
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <Button
                            Name="ButtonTaskNote"
                            Content="{Binding}"
                            ContentTemplate="{StaticResource TaskNoteItem}"
                            Command="{Binding ElementName=ListNotes, Path=DataContext.NavigateToTaskNoteCommand}"
                            CommandParameter="{Binding}"
                            Style="{DynamicResource TaskNoteButtonStyle}"
                            Click="ButtonTaskNote_Click" />
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </ScrollViewer>
    </DockPanel>
</Page>
